﻿//(c) Alexandru Ghiondea, 2011
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace JSONDotNET
{
    public static class TokenExtensions
    {
        /// <summary>
        /// The method returns whether or not the current token represents an escaped whitespace
        /// </summary>
        /// <returns></returns>
        public static bool isEscapedWhiteSpace(this Token tok)
        {
            if (tok.kind != TokenKind.EscapedCharacter)
                return false;

            if (tok.value != "n" && tok.value != "t" && tok.value != "r" && tok.value != "f")
                return false;

            return true;
        }

    }
}
